home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 015 / pushpop.arc / PUSHPOP.DOC < prev    next >
Encoding:
Text File  |  1986-04-17  |  6.5 KB  |  133 lines

  1.  
  2.                               Screen-Image Files
  3.  
  4.                                 Larry Lockwood
  5.                        Orange County IBM PC Users Group
  6.  
  7.     Last December I chaired a meeting at which over thirty representatives
  8.     of Naval and Air Force installations from around the country attended a
  9.     demonstration of a cruise missile data base using an IBM PC with a 23MB
  10.     external hard disk.  All morning, these people stood while the software
  11.     laboriously ground through the data base, time after agonizing time.
  12.     Since the objective of the demonstration was to present results (not
  13.     the manipulations required to produce the results), we all wasted a
  14.     morning that could have been more productively spent on other agenda
  15.     items.
  16.  
  17.     That night, as I thought of how the demonstration might have been
  18.     handled if only I had had some additional equipment, it occurred to me
  19.     that snapshots and software might work together.  I'd create a program
  20.     that would take "snapshots" of CRT displays and store them in a file.
  21.     A second program would recall them.  It would take a week or so and
  22.     wouldn't cost a thing (except the programming time at home each
  23.     evening).  By March, I had created two assembly language programs,
  24.     which I called PUSH and POP because I saw a similiarity between
  25.     saving/restoring a CRT image on a file and pushing/popping a register
  26.     to a stack.
  27.  
  28.     PUSH.COM is the program that, once loaded, remains resident in memory.
  29.     When it has been loaded, the CRT display can be copied to a
  30.     screen-image file by concurrently depressing the Shift-PrtSc keys.  You
  31.     can no longer use Shift-PrtSc to copy the CRT display to the printer
  32.     until you reboot (IPL) the computer.
  33.  
  34.     The syntax for loading PUSH.COM is
  35.  
  36.               PUSH drive:filename (do not use a file extension)
  37.  
  38.     For example, suppose PUSH.COM is on the diskette in drive A and you
  39.     wish to create a series of screen-image files named SNAPSHOT on a
  40.     diskette in drive B.  The installation entry would be:
  41.  
  42.               PUSH b:snapshot
  43.  
  44.     When you first press the Shift-PrtSc keys, PUSH will create a
  45.     screen-image file named SNAPSHOT.001 on the diskette in drive B.  The
  46.     second time the Shift-PrtSc keys are pressed, another screen-image
  47.     file, SNAPSHOT.002, will be created, and so on.
  48.  
  49.     When you save a text screen, the corresponding screen-image file size
  50.     is 4100 bytes.  A graphics screen will create a corresponding 16,300
  51.     byte screen-image file.  You can copy approximately 88 text images or
  52.     22 graphics images to a 360KB diskette.  Once you create a series of
  53.     screen-image files, use the DOS RENAME command to give your files more
  54.     meaningful names.   POP.COM restores a screen-image file to the
  55.     display.  The syntax, using the example above, would be
  56.  
  57.               POP B:SNAPSHOT.001
  58.  
  59.     When I first tried POP.COM, I found that it always restored graphics
  60.     images on a black background with the palette 0 foreground colors
  61.     (cyan, white, and magenta).  After digging through the Technical
  62.     Reference Manual, I concluded that these are the default IBM PC color
  63.     settings and there was no way that I could rewrite PUSH.COM to capture
  64.     the Color Select Register setting (it's a write-only register).  My
  65.     only choice was to modify POP.COM to provide a means of restoring the
  66.     original colors via function keys.  While I was at it, it occurred to
  67.     me that the function keys could also be used to change the attributes
  68.     of individual characters in text files.
  69.  
  70.     One thing led to another and what finally evolved was a POP.COM program
  71.     that restores the original screen image and allows you to modify almost
  72.     everything.  The function keys do the following:
  73.  
  74.          F1 - Changes background colors of graphics images and border
  75.               colors of text images.
  76.  
  77.          F2 - Toggles graphics foreground colors back and forth
  78.               between palettes 0 and 1.
  79.  
  80.          F3 - Selects background colors for individual characters in
  81.               text mode.
  82.  
  83.          F4 - Selects foreground colors for individual characters in
  84.               text mode.
  85.  
  86.          F5 - Exercises your left forefinger.
  87.  
  88.          F6 - Controls individual character blinking.
  89.  
  90.          Shift-F7 - Reloads the original screen-image file again.
  91.               (Use this if you've made modifications that you don't
  92.               like and decide it would be quicker to just start all
  93.               over again.)
  94.  
  95.          Shift-F8 - Saves modified image back to the disk with the
  96.               original filename.  (Careful -- this destroys the
  97.               original image.)
  98.  
  99.          Esc - Exits and returns to DOS without saving modified
  100.               screen.
  101.  
  102.          Other keys - The cursor keys are functional in text and
  103.               graphics modes, as are the alphanumeric keys.  In
  104.               graphics mode, however, the cursor is implemented as a
  105.               one-pixel dot that moves around the screen.  It starts
  106.               in the upper left-hand corner of the screen, but you
  107.               won't see it until one of the cursor keys is depressed.
  108.               The Home key moves the cursor up-left and the End key
  109.               moves it down-left.  The Ctrl key, when used in
  110.               conjunction with the alphanumeric keys, produce the IBM
  111.               PC symbols associated with the various control codes.
  112.               If you have the IBM Technical Reference Manual, the
  113.               symbols are shown on page C-1.  If not, just experiment.
  114.  
  115.  
  116.     These programs were written specifically for an IBM PC with a
  117.     Color/Graphics Monitor Adapter.  Any compatibility with other PCs or
  118.     adapters is strictly coincidental.  These programs will not work with a
  119.     Monochrome Display Adapter, because both PUSH and POP read from, and
  120.     write to, the color display memory at B800h.  Also, the IBM Monochrome
  121.     Display Adapter has no graphics capabilities.
  122.  
  123.     Perhaps the simplest way to provide continuous, sequential viewing of
  124.     screen-images files is to create BATch files with the filenames
  125.     separated by PAUSE commands.
  126.  
  127.     [Note:  We have placed Mr.  Lockwood's PUSH.COM and POP.COM
  128.     programs in the <F>iles section.]
  129.  
  130.     (This article may be reprinted provided credit is given to the
  131.     original author and to the Exchange newsletter.)
  132.  
  133.